home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / aspipat.zip / ASPIPATC < prev    next >
Text File  |  1992-01-26  |  11KB  |  359 lines

  1. *** ../tar-1.10/Makefile    Wed Jun 26 07:29:06 1991
  2. --- Makefile    Wed Jan 15 01:35:02 1992
  3. ***************
  4. *** 159,164 ****
  5. --- 159,182 ----
  6.   #DEFBLOCKING = 20
  7.   #O = obj
  8.   
  9. + # (Yeah!) MS-DOS (Microsoft C 5.1) version
  10. + # if you don't want the aspi functions just remove the -DASPI from the
  11. + # DEFS line and the aspi.c and aspi.$O from LOCAL_SRC & LOCAL_OBJ
  12. + #CC = cl
  13. + #MODEL = M
  14. + #DEFS = -nologo -DNONAMES -D__MSDOS__ -A$(MODEL) -DNO_REMOTE -DASPI
  15. + #LOCAL_SRC =  getdate.c  aspi.c
  16. + #LOCAL_OBJ =  getdate.$O aspi.$O
  17. + #LDFLAGS =
  18. + #LIBS = $(MODEL)dir.lib
  19. + #LINT = $(CC)
  20. + #LINTFLAGS = -W3
  21. + #DEF_AR_FILE = \"tar.out\"
  22. + ## for the next line see the file ASPI.DOC
  23. + #DEFAULT_TAPE_ID = \"0:4:0\"
  24. + #DEFBLOCKING = 20
  25. + #O = obj
  26.   # V7 version
  27.   # Pick open3 emulation or nonexistence.  See open3.h, port.c.
  28.   ##DEFS = -DV7 -DEMUL_OPEN3 -Dvoid=int
  29. ***************
  30. *** 269,280 ****
  31.   testpad: testpad.o
  32.       $(CC) -o testpad testpad.o
  33.   
  34. ! # command is too long for Messy-Dos (128 char line length limit) so
  35. ! # this kludge is used...
  36. ! #    @echo $(OBJ1) + > command
  37. ! #    @echo $(OBJ2) >> command
  38. ! #    link @command, $@,,$(LIBS) /NOI;
  39. ! #    @$(RM) command
  40.   
  41.   install: all
  42.       $(RM) $(bindir)/tar
  43. --- 287,316 ----
  44.   testpad: testpad.o
  45.       $(CC) -o testpad testpad.o
  46.   
  47. ! # This is for MSDOS, say "make dossall" instead of "make all"
  48. ! dosall: tar.exe ctctrl.exe
  49. ! tar.exe: $(OBJS)
  50. !     @echo $(OBJ1) + >linkcmd
  51. !     @echo $(OBJ2) + >> linkcmd
  52. !     @echo $(OBJ3) >> linkcmd
  53. !     link @linkcmd, $@,,,, /NOI
  54. ! ctctrl.exe: getopt.$O ctctrl.$O scsi.$O
  55. !     $(CC) $(COPTS) $(LDFLAGS) -o ctctrl getopt.$O ctctrl.$O scsi.$O
  56. ! ctctrl.obj: ctctrl.c scsi.h scsierr.h aspi.h
  57. !  
  58. ! aspi.obj: aspi.c
  59. !     $(CC) -nologo $(COPTS) -A$(MODEL) -DTAPE_ID=$(DEFAULT_TAPE_ID) \
  60. !     -c aspi.c
  61. ! scsi.obj: aspi.c
  62. !     $(CC) -nologo $(COPTS) -A$(MODEL) -DTAPE_ID=$(DEFAULT_TAPE_ID) \
  63. !     -DCTCTRL /Foscsi.obj -c aspi.c
  64.   
  65.   install: all
  66.       $(RM) $(bindir)/tar
  67. *** ../tar-1.10/diffarch.c    Thu Dec 13 21:13:20 1990
  68. --- diffarch.c    Wed Jan 15 00:13:57 1992
  69. ***************
  70. *** 39,44 ****
  71. --- 39,46 ----
  72.   #if !defined(USG) || defined(HAVE_MTIO)
  73.   #include <sys/mtio.h>
  74.   #endif
  75. + #else
  76. + #include <fcntl.h>
  77.   #endif
  78.   
  79.   #ifdef USG
  80. ***************
  81. *** 189,195 ****
  82.           }
  83.   
  84.           diff_fd = open(head->header.name, O_NDELAY|O_RDONLY);
  85.           if (diff_fd < 0 && !f_absolute_paths) {
  86.               char tmpbuf[NAMSIZ+2];
  87.   
  88. --- 191,199 ----
  89.           }
  90.   
  91.           diff_fd = open(head->header.name, O_NDELAY|O_RDONLY);
  92. ! #ifdef __MSDOS__
  93. !                 setmode(diff_fd, O_BINARY);
  94. ! #endif
  95.           if (diff_fd < 0 && !f_absolute_paths) {
  96.               char tmpbuf[NAMSIZ+2];
  97.   
  98. ***************
  99. *** 359,365 ****
  100. --- 363,373 ----
  101.               break;
  102.           }
  103.   
  104. + #ifndef __MSDOS__
  105.           diff_fd = open(head->header.name, O_NDELAY|O_RDONLY);
  106. + #else
  107. +                 diff_fd = open(head->header.name, O_NDELAY|O_RDONLY|O_BINARY);
  108. + #endif
  109.   
  110.           if (diff_fd < 0) {
  111.               msg_perror("cannot open file %s",head->header.name);
  112. ***************
  113. *** 395,411 ****
  114.   {
  115.       int err;
  116.   
  117. !     err=read(diff_fd,diff_buf,bytes);
  118. !     if(err!=bytes) {
  119.           if(err<0) {
  120.               msg_perror("can't read %s",head->header.name);
  121.           } else {
  122. !             fprintf(msg_file,"%s: could only read %d of %d bytes\n",head->header.name,err,bytes);
  123.           }
  124.           different++;
  125.           return -1;
  126.       }
  127. !     if(bcmp(buffer,diff_buf,bytes)) {
  128.           fprintf(msg_file, "%s: data differs\n",head->header.name);
  129.           different++;
  130.           return -1;
  131. --- 403,419 ----
  132.   {
  133.       int err;
  134.   
  135. !         err=read(diff_fd,diff_buf,( unsigned ) bytes);
  136. !         if(err!=( int ) bytes) {
  137.           if(err<0) {
  138.               msg_perror("can't read %s",head->header.name);
  139.           } else {
  140. !                         fprintf(msg_file,"%s: could only read %d of %ld bytes\n",head->header.name,err,bytes);
  141.           }
  142.           different++;
  143.           return -1;
  144.       }
  145. !         if(bcmp(buffer,diff_buf,( unsigned ) bytes)) {
  146.           fprintf(msg_file, "%s: data differs\n",head->header.name);
  147.           different++;
  148.           return -1;
  149. ***************
  150. *** 418,424 ****
  151.   long bytes;
  152.   char *buffer;
  153.   {
  154. !     if(bcmp(buffer,diff_dir,bytes)) {
  155.           fprintf(msg_file, "%s: data differs\n",head->header.name);
  156.           different++;
  157.           return -1;
  158. --- 426,432 ----
  159.   long bytes;
  160.   char *buffer;
  161.   {
  162. !         if(bcmp(buffer,diff_dir,( unsigned ) bytes)) {
  163.           fprintf(msg_file, "%s: data differs\n",head->header.name);
  164.           different++;
  165.           return -1;
  166. ***************
  167. *** 556,562 ****
  168.                    if (err < 0) 
  169.                       msg_perror("can't read %s", head->header.name);
  170.                   else
  171. !                     fprintf(msg_file, "%s: could only read %d of %d bytes\n", 
  172.                           err, numbytes);
  173.                   break;
  174.               }
  175. --- 564,570 ----
  176.                    if (err < 0) 
  177.                       msg_perror("can't read %s", head->header.name);
  178.                   else
  179. !                                         fprintf(msg_file, "%s: could only read %d of %ld bytes\n",
  180.                           err, numbytes);
  181.                   break;
  182.               }
  183. ***************
  184. *** 569,584 ****
  185.               userec(datarec);
  186.               datarec = findrec();
  187.           }
  188. !         if ((err = read(diff_fd, buf, numbytes)) != numbytes) {
  189.                if (err < 0) 
  190.                   msg_perror("can't read %s", head->header.name);
  191.               else
  192. !                 fprintf(msg_file, "%s: could only read %d of %d bytes\n", 
  193.                           err, numbytes);
  194.               break;
  195.           }
  196.   
  197. !         if (bcmp(buf, datarec->charptr, numbytes)) {
  198.               different++;
  199.               break;
  200.           }
  201. --- 577,592 ----
  202.               userec(datarec);
  203.               datarec = findrec();
  204.           }
  205. !                 if ((err = read(diff_fd, buf, ( unsigned ) numbytes)) != (int) numbytes) {
  206.                if (err < 0) 
  207.                   msg_perror("can't read %s", head->header.name);
  208.               else
  209. !                                 fprintf(msg_file, "%s: could only read %d of %ld bytes\n",
  210.                           err, numbytes);
  211.               break;
  212.           }
  213.   
  214. !                 if (bcmp(buf, datarec->charptr, ( unsigned ) numbytes)) {
  215.               different++;
  216.               break;
  217.           }
  218. *** ../tar-1.10/getopt.c    Thu Jun 20 05:14:03 1991
  219. --- getopt.c    Wed Jan 15 01:52:38 1992
  220. ***************
  221. *** 59,65 ****
  222.   char *malloc ();
  223.   #endif /* STDC_HEADERS or __GNU_LIBRARY__ */
  224.   
  225. ! #if defined(USG) || defined(STDC_HEADERS) || defined(__GNU_LIBRARY__)
  226.   #include <string.h>
  227.   #define bcopy(s, d, n) memcpy ((d), (s), (n))
  228.   #define index strchr
  229. --- 59,65 ----
  230.   char *malloc ();
  231.   #endif /* STDC_HEADERS or __GNU_LIBRARY__ */
  232.   
  233. ! #if defined(USG) || defined(STDC_HEADERS) || defined(__GNU_LIBRARY__) || defined(MSDOS)
  234.   #include <string.h>
  235.   #define bcopy(s, d, n) memcpy ((d), (s), (n))
  236.   #define index strchr
  237. *** ../tar-1.10/port.c    Mon May 20 19:55:06 1991
  238. --- port.c    Wed Jan 15 00:14:09 1992
  239. ***************
  240. *** 651,657 ****
  241.   
  242.   #ifdef    WANT_MKNOD
  243.   #ifdef __MSDOS__
  244. ! typedef int dev_t;
  245.   #endif
  246.   /* Fake mknod by complaining */
  247.   int
  248. --- 651,657 ----
  249.   
  250.   #ifdef    WANT_MKNOD
  251.   #ifdef __MSDOS__
  252. ! /* typedef int dev_t;  /* we don't need this with MSC 5.1 or later */
  253.   #endif
  254.   /* Fake mknod by complaining */
  255.   int
  256. *** ../tar-1.10/rmt.h    Thu Oct 25 19:59:32 1990
  257. --- rmt.h    Wed Jan 15 00:14:13 1992
  258. ***************
  259. *** 18,33 ****
  260.   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  261.   
  262.   #ifdef NO_REMOTE
  263. ! #define _isrmt(f)    0
  264.   #define rmtopen        open
  265. - #define rmtaccess    access
  266. - #define rmtstat        stat
  267. - #define rmtcreat    creat
  268. - #define rmtlstat    lstat
  269.   #define rmtread        read
  270.   #define rmtwrite    write
  271. ! #define rmtlseek    lseek
  272.   #define rmtclose    close
  273.   #define rmtioctl    ioctl
  274.   #define rmtdup        dup
  275.   #define rmtfstat    fstat
  276. --- 18,50 ----
  277.   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  278.   
  279.   #ifdef NO_REMOTE
  280. ! #ifdef ASPI
  281. ! extern int aspiopen(char *, int, int);
  282. ! extern int aspiread(int, char *, int);
  283. ! extern int aspiwrite(int, char *, int);
  284. ! extern int aspicreat(char *, int);
  285. ! extern int aspiclose( int );
  286. ! extern long aspilseek(int, long, int);
  287. ! #define rmtopen         aspiopen
  288. ! #define rmtread         aspiread
  289. ! #define rmtwrite        aspiwrite
  290. ! #define rmtcreat        aspicreat
  291. ! #define rmtclose        aspiclose
  292. ! #define rmtlseek        aspilseek
  293. ! #else
  294.   #define rmtopen        open